Skip to content

Fix #4124: Boards: Hide tasks from hidden projects #4186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025

Conversation

davidrr21
Copy link
Contributor

#4124
The visibility of each task aligns with the visibility of the corresponding project in the boards section.

Description

The issue was that the toggleHideFromMenu function in the project service was never being called, and there was no interaction between the visibility of a project and its associated tasks.

Implementation

I introduced a flag in tasks called unavailable, which changes according to the visibility of the respective project.

Previously, when changing the project's visibility in side-nav.component.html, the toggleProjectVisibility function in side-nav.component.ts was called, directly modifying the isHiddenFromMenu flag of the project.

Now, nav.component.html calls toggleProjectVisibility in side-nav.component.ts, which invokes the projectHideFromMenu service, triggering the toggleHideFromMenu action.

In the project reducer, the isHiddenFromMenu flag is updated, and in the tasks reducer, the unavailable flags of all tasks associated with the project are updated accordingly.

When the board selects tasks to display, it uses a new selector called selectAllAvailableTasksWithSubTasks, which filters only the tasks that are available.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello there davidrr21! 👋

Thank you and congrats 🎉 for opening your first PR on this project! ✨ 💖

We will try to review it soon!

Copy link
Owner

@johannesjo johannesjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this! While I generally would like to see this feature, I think I'd prefer if the this would be done on the data mapping level rather, than changing the actual (persisted) model.

@@ -113,6 +113,24 @@ export const taskReducer = createReducer<TaskState>(
});
}),

on(toggleHideFromMenu, (state, { projectId, allTaskIds, isHiddenFromMenu }) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather avoid updating the task model itself for this, since it might complicate things further down the road, adds additional data size and logically the hidden state belongs more to the project model, than the task model.

@johannesjo johannesjo added the needs work PRs that need additional changes. label Mar 28, 2025
@davidrr21
Copy link
Contributor Author

Hi @johannesjo ,

Apologies for the delay in getting back to this – I’ve now pushed the requested changes to the PR. Please let me know if there’s anything else you’d like me to adjust.

Thanks again for your patience!

Best regards

@johannesjo
Copy link
Owner

Thank you very much for the adjustments! It seems there are a lot of conflicts. Could you maybe have a look?

The visibility of each task is in accordance with the
visibility of the corresponding project in the boards
section
Now the issues related to hidden and backlog are fully handled on the project side,
only needing a selector that I created on the tasks side to filter.
@davidrr21
Copy link
Contributor Author

Hi @johannesjo ,

The conflicts should now be fixed.
Please let me know if there’s anything else you’d like me to adjust.

Best regards

@johannesjo
Copy link
Owner

Thank you.

@johannesjo johannesjo merged commit 321778e into johannesjo:master Apr 25, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs work PRs that need additional changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants